Skip to contentSkip to conversation

Change in openvpn[master]: t_client.sh: conditionally skip ifconfig+route check

Openvpn-devel In review cron2 (Code Review) 2 participants 8 messages Sep 24, 2024 – Sep 28, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1727186481000.Iec1953415afb53755488dd44407568e72d28e854@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/768?usp=email

to review the following change.

Change subject: t_client.sh: conditionally skip ifconfig+route check
......................................................................

t_client.sh: conditionally skip ifconfig+route check

For --dev null or --dev-type af_unix:lwipopenvn tests, there will be no visible change to ifconfig or route output, so tests will fail ("how can this be?"). Set EXPECT_IFCONFIG4_<n>=- to skip this check.

(Simply leaving both EXPECT_IFCONFIG* vars empty and using that as trigger would interfere with the magic from commit df0b00c25)

Change-Id Iec1953415afb53755488dd44407568e72d28e854

---
M tests/t_client.sh.in

1 file changed, 11 insertions(+), 6 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/68/768/1

tests/t_client.sh.in +11 -6
index f6654dd..3b9209d 100755
@@ -225,6 +225,7 @@
     expect_list="$@"
 
     if [ -z "$expect_list" ] ; then return ; fi
+    if [ "$expect_list" = "-" ] ; then return ; fi
 
     for expect in $expect_list
     do
@@ -404,13 +405,17 @@
     output "save ifconfig+route"
     get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
 
-    output -n "compare pre-openvpn ifconfig+route with current values..."
-    if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
-	    $LOGDIR/$SUF:ifconfig_route.txt >/dev/null
-    then
-	fail "no differences between ifconfig/route before OpenVPN start and now."
+    if [ "$expect_ifconfig4" == "-" ] ; then
+        output "skip ifconfig+route check"
     else
-	output " OK!\n"
+	output -n "compare pre-openvpn ifconfig+route with current values..."
+	if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+		$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
+	then
+	    fail "no differences between ifconfig/route before OpenVPN start and now."
+	else
+	    output " OK!\n"
+	fi
     fi
 
     # post init script needed?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/768?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Gerrit-Change-Number: 768
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/768?usp=email )

Change subject: t_client.sh: conditionally skip ifconfig+route check
......................................................................

Patch Set 1: Code-Review-1

(2 comments)

Patchset:

PS1:
generally looks reasonable

File tests/t_client.sh.in:

http://gerrit.openvpn.net/c/openvpn/+/768/comment/4d512c5b_f0612d03 :
PS1, Line 408: if [ "$expect_ifconfig4" == "-" ] ; then
The rest of the code uses "=" not "==", so let's be consistent

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/768?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Gerrit-Change-Number: 768
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Comment-Date: Fri, 27 Sep 2024 09:41:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, plaisthos.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/768?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review-1 by flichtenheld

Change subject: t_client.sh: conditionally skip ifconfig+route check
......................................................................

t_client.sh: conditionally skip ifconfig+route check

For --dev null or --dev-type af_unix:lwipopenvn tests, there will be no visible change to ifconfig or route output, so tests will fail ("how can this be?"). Set EXPECT_IFCONFIG4_<n>=- to skip this check.

(Simply leaving both EXPECT_IFCONFIG* vars empty and using that as trigger would interfere with the magic from commit df0b00c25)

v2: fix string-equal comparison

Change-Id Iec1953415afb53755488dd44407568e72d28e854

---
M tests/t_client.sh.in

1 file changed, 11 insertions(+), 6 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/68/768/2

tests/t_client.sh.in +11 -6
index f6654dd..1ccadeb 100755
@@ -225,6 +225,7 @@
     expect_list="$@"
 
     if [ -z "$expect_list" ] ; then return ; fi
+    if [ "$expect_list" = "-" ] ; then return ; fi
 
     for expect in $expect_list
     do
@@ -404,13 +405,17 @@
     output "save ifconfig+route"
     get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
 
-    output -n "compare pre-openvpn ifconfig+route with current values..."
-    if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
-	    $LOGDIR/$SUF:ifconfig_route.txt >/dev/null
-    then
-	fail "no differences between ifconfig/route before OpenVPN start and now."
+    if [ "$expect_ifconfig4" = "-" ] ; then
+        output "skip ifconfig+route check"
     else
-	output " OK!\n"
+	output -n "compare pre-openvpn ifconfig+route with current values..."
+	if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+		$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
+	then
+	    fail "no differences between ifconfig/route before OpenVPN start and now."
+	else
+	    output " OK!\n"
+	fi
     fi
 
     # post init script needed?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/768?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Gerrit-Change-Number: 768
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/768?usp=email )

Change subject: t_client.sh: conditionally skip ifconfig+route check
......................................................................

Patch Set 2: Code-Review+2

(1 comment)

File tests/t_client.sh.in:

http://gerrit.openvpn.net/c/openvpn/+/768/comment/289b91ad_8a8b5afc :
PS1, Line 408: if [ "$expect_ifconfig4" == "-" ] ; then

Quoted 1 line

The rest of the code uses "=" not "==", so let's be consistent

Done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/768?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Gerrit-Change-Number: 768
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Comment-Date: Fri, 27 Sep 2024 10:28:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#5 lore raw

PATCH v2 1/1 t_client.sh: conditionally skip ifconfig+route check

In reply to a message not in the archive

For --dev null or --dev-type af_unix:lwipopenvn tests, there will be no visible change to ifconfig or route output, so tests will fail ("how can this be?"). Set EXPECT_IFCONFIG4_<n>=- to skip this check.

(Simply leaving both EXPECT_IFCONFIG* vars empty and using that as trigger would interfere with the magic from commit df0b00c25)

v2: fix string-equal comparison

Change-Id Iec1953415afb53755488dd44407568e72d28e854

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/768
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

tests/t_client.sh.in +11 -6
index f6654dd..1ccadeb 100755
@@ -225,6 +225,7 @@
     expect_list="$@"
 
     if [ -z "$expect_list" ] ; then return ; fi
+    if [ "$expect_list" = "-" ] ; then return ; fi
 
     for expect in $expect_list
     do
@@ -404,13 +405,17 @@
     output "save ifconfig+route"
     get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
 
-    output -n "compare pre-openvpn ifconfig+route with current values..."
-    if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
-	    $LOGDIR/$SUF:ifconfig_route.txt >/dev/null
-    then
-	fail "no differences between ifconfig/route before OpenVPN start and now."
+    if [ "$expect_ifconfig4" = "-" ] ; then
+        output "skip ifconfig+route check"
     else
-	output " OK!\n"
+	output -n "compare pre-openvpn ifconfig+route with current values..."
+	if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+		$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
+	then
+	    fail "no differences between ifconfig/route before OpenVPN start and now."
+	else
+	    output " OK!\n"
+	fi
     fi
 
     # post init script needed?
#6 lore raw

[Openvpn-devel] [PATCH applied] Re: t_client.sh: conditionally skip ifconfig+route check

Tested (quite a bit :-) ) in the testing phase of the AF_UNIX patch set...

Patch has been applied to the master branch.

commit 5ccaa49e0323ce468b156b3fa0930f7840050387

Author: Gert Doering
Date:   Sat Sep 28 22:05:08 2024 +0200
     t_client.sh: conditionally skip ifconfig+route check

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg29473.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#7 lore raw
In reply to a message not in the archive

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/768?usp=email

to look at the new patch set (#3).

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: t_client.sh: conditionally skip ifconfig+route check
......................................................................

t_client.sh: conditionally skip ifconfig+route check

For --dev null or --dev-type af_unix:lwipopenvn tests, there will be no visible change to ifconfig or route output, so tests will fail ("how can this be?"). Set EXPECT_IFCONFIG4_<n>=- to skip this check.

(Simply leaving both EXPECT_IFCONFIG* vars empty and using that as trigger would interfere with the magic from commit df0b00c25)

v2: fix string-equal comparison

Change-Id Iec1953415afb53755488dd44407568e72d28e854

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29473.html

---
M tests/t_client.sh.in

1 file changed, 11 insertions(+), 6 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/68/768/3

tests/t_client.sh.in +11 -6
index f6654dd..1ccadeb 100755
@@ -225,6 +225,7 @@
     expect_list="$@"
 
     if [ -z "$expect_list" ] ; then return ; fi
+    if [ "$expect_list" = "-" ] ; then return ; fi
 
     for expect in $expect_list
     do
@@ -404,13 +405,17 @@
     output "save ifconfig+route"
     get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
 
-    output -n "compare pre-openvpn ifconfig+route with current values..."
-    if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
-	    $LOGDIR/$SUF:ifconfig_route.txt >/dev/null
-    then
-	fail "no differences between ifconfig/route before OpenVPN start and now."
+    if [ "$expect_ifconfig4" = "-" ] ; then
+        output "skip ifconfig+route check"
     else
-	output " OK!\n"
+	output -n "compare pre-openvpn ifconfig+route with current values..."
+	if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+		$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
+	then
+	    fail "no differences between ifconfig/route before OpenVPN start and now."
+	else
+	    output " OK!\n"
+	fi
     fi
 
     # post init script needed?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/768?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Gerrit-Change-Number: 768
Gerrit-PatchSet: 3
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#8 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/768?usp=email )

Change subject: t_client.sh: conditionally skip ifconfig+route check
......................................................................

t_client.sh: conditionally skip ifconfig+route check

For --dev null or --dev-type af_unix:lwipopenvn tests, there will be no visible change to ifconfig or route output, so tests will fail ("how can this be?"). Set EXPECT_IFCONFIG4_<n>=- to skip this check.

(Simply leaving both EXPECT_IFCONFIG* vars empty and using that as trigger would interfere with the magic from commit df0b00c25)

v2: fix string-equal comparison

Change-Id Iec1953415afb53755488dd44407568e72d28e854

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg29473.html

---
M tests/t_client.sh.in

1 file changed, 11 insertions(+), 6 deletions(-)
tests/t_client.sh.in +11 -6
index f6654dd..1ccadeb 100755
@@ -225,6 +225,7 @@
     expect_list="$@"
 
     if [ -z "$expect_list" ] ; then return ; fi
+    if [ "$expect_list" = "-" ] ; then return ; fi
 
     for expect in $expect_list
     do
@@ -404,13 +405,17 @@
     output "save ifconfig+route"
     get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
 
-    output -n "compare pre-openvpn ifconfig+route with current values..."
-    if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
-	    $LOGDIR/$SUF:ifconfig_route.txt >/dev/null
-    then
-	fail "no differences between ifconfig/route before OpenVPN start and now."
+    if [ "$expect_ifconfig4" = "-" ] ; then
+        output "skip ifconfig+route check"
     else
-	output " OK!\n"
+	output -n "compare pre-openvpn ifconfig+route with current values..."
+	if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
+		$LOGDIR/$SUF:ifconfig_route.txt >/dev/null
+	then
+	    fail "no differences between ifconfig/route before OpenVPN start and now."
+	else
+	    output " OK!\n"
+	fi
     fi
 
     # post init script needed?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/768?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec1953415afb53755488dd44407568e72d28e854
Gerrit-Change-Number: 768
Gerrit-PatchSet: 3
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged